function addRoleDialog(callback = Function()) {
    const $form = $(`
        <form class="mask-account">
            <div style="margin: 0">
                <span class="mask-account-tit"><sub style="color: red;">*</sub> 角色名</span>
                <span class="input-select"><input type="text" name="title" placeholder="请输入角色名" /></span>
            </div>
        </form>
    `)

    const $alertWidget = $.dialog($form, {
        title: "新增角色",
        width: "400px",
        ok: () => {
            const data = $.getFormData($form);
            addRole(data, res => {
                const {Code, Message} = res;
                if (Code !== 10000) {
                    return $.toast(Message);
                }

                $alertWidget.remove();
                $.toast("添加成功");
                callback();
            })

            return false;
        }
    })

    function addRole(param, callback = Function()) {
        return $.sApi({
            data: param,
            url: "/api/Role/addRole"
        }, callback)
    }
}